# Maintainer: Patrycja Rosa <alpine@ptrcnull.me>
pkgname=sish
pkgver=2.16.0
pkgrel=2
pkgdesc="HTTP(S)/WS(S)/TCP Tunnels to localhost using only SSH"
url="https://github.com/antoniomika/sish"
# s390x, riscv64: doesn't compile
arch="all !s390x !riscv64"
license="MIT"
makedepends="go"
install="$pkgname.pre-install"
subpackages="$pkgname-openrc"
source="https://github.com/antoniomika/sish/archive/refs/tags/v$pkgver/sish-$pkgver.tar.gz
	sish.initd
	sish.confd
	0001-fix-build-error-on-loongarch64.patch
	"
# !check: no tests provided by upstream
# net: download go modules
options="!check net"

build() {
	go build -o sish
}

package() {
	install -Dm755 sish "$pkgdir"/usr/bin/sish
	install -Dm644 config.example.yml "$pkgdir"/etc/sish/config.yml

	install -Dm755 "$srcdir"/sish.initd "$pkgdir"/etc/init.d/sish
	install -Dm644 "$srcdir"/sish.confd "$pkgdir"/etc/conf.d/sish
}

sha512sums="
2ad384541f04176a8f6b2384e0941cd5b1c5011f881cbe6b3116f111092bf958c2d7d399c2262e0391c2a3e8616159c38ed50196501731a93ef2b580fa8ac98f  sish-2.16.0.tar.gz
8d810e48e3106babdce734e4f83249c62de5b562c7b1c50a33914c426b5406f958d3b5868f68af1f1f766142b5cd1ef60f19457f059ff6f1985cae6001d79398  sish.initd
4b1e752dcd49ce7d8f145ad0b8bc3ea5a86dc322dc61048364a7c36386dfb21ea8b243d41bebc3db96c9c490f6b6e7e006536fe4ebfd27078f5b32181b8dd5d4  sish.confd
bffa22aa0095e931a7d75e01cfb71337af40738e2a2173379c3fb3bc0bfbc5d4d3609b035b6a16aa9e6d102c91ec5f0ed7948df474694018effef7a3c00d2a23  0001-fix-build-error-on-loongarch64.patch
"
